package com.xinlianshiye.im.bean

import javax.persistence.*

/**
 * @Author zw 好友表
 * @Description //TODO
 * @Date 15:04 2019/8/6
 * @Param
 */
@Entity
@Table(name = "im_friends")
class Friend: Domain() {

    @ManyToOne
    @JoinColumn(name = "`usr`", foreignKey = ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    var user // 好友的用户 》》》关联用户
            : User? = null

    @ManyToOne
    @JoinColumn(name = "friend", foreignKey = ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    var friend // 好友 》》》关联用户
            : User? = null

    @ManyToOne
    @JoinColumn(name = "groupfriends", columnDefinition = "INT(11) COMMENT '分组'", updatable = false, insertable = false)
    var userGroup // 好友属于对应用户的哪个分组  》》》关联分组
            : UserGroup? = null

    @Column(name = "groupfriends")
    var userGroupId: Int? = null
}